package Command_Pattern.Calculator;

import java.sql.SQLOutput;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class CalculatorForm {
    private AbstractCommand command;
    private CommandQueue commandQueue;
    public void setCommand(AbstractCommand command) {
        this.command = command;
    }
    public void compute(int value){
        int i=command.execute(value);
        System.out.println("结果为"+i);
    }
    public void undo(){
        commandQueue.execute();
        //        int i =command.undo();
//        System.out.println("撤销"+i);
    }
    public void redo(){
        int i=command.redo();
        System.out.println("再撤销"+i);
    }
}
